<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <title>科目一信息录入</title>
  <meta name="description" content="科目一信息录入">
  <meta name="keywords" content="user">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="assets/css/admin.css">
  <script src="assets/js/jquery.min.js"></script>
  <script src="assets/js/amazeui.min.js"></script>
  <script src="assets/js/app.js"></script>
  <script type="text/javascript">
    $(function(){
        /*公共部分
         */
        $(".headerpage").load("Head.html"); 
        $(".navigation").load("Navigation.html");
        if(sessionStorage.getItem('user_token')==null){
     	window.location.href="index.html";
     }
    });
    
    /**
     * 提交录入信息
     */
    $(function(){
    	$("#userBut").click(function(){ 
    			var gdata ={
    	  	"name": $("#name").val(),
    	  	"identity": $("#identity").val(),   	 	
    	  	"examTime": $("#examTime").val(),
    	  	"examPlace": $("#examPlace").val(),
    	  	"score": $("#score").val(),
    	  	"isrepeat": $("#isrepeatExam").val(),
    	  	"repeatNum": $("#repeatNum").val(),
      	}
    		
      	$.ajax({
          		url : "http://121.5.208.41:8085/subtow/insert",
			      	type : "post",
		          contentType : "application/json;charset=utf-8",
		          beforeSend: function (XMLHttpRequest) {
                    XMLHttpRequest.setRequestHeader("token", sessionStorage.getItem('user_token'));
                },
		          data : JSON.stringify(gdata),
		          dataType :"json",
		          success : function(data){
		          	if (data.code == "LRCG") {
		          		alert("录入成功");
		          		window.location.href="subTow.html";
		          	}else{
		          		alert(data.msg)
		          	}
		          }
    	  })	
    	})
    	
    	$("#ButFh").click(function(){
    		window.location.href="subTow.html";
    	})
    	
    	
    })
    
    
  </script>
  
</head>
<body>
<header class="headerpage"></header>

<div class="am-cf admin-main"> 
  <!--菜单栏-->
  <div class="navigation"></div>

  <!-- content start -->
  <div class="admin-content">
    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">录入</strong>/科目二信息</div>
    </div>
    <hr/>

    <div class="am-g">
      <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8"></div>
      
      <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
        <div class="am-form am-form-horizontal"> 
        	
          <div class="am-form-group">
            <label  class="am-u-sm-3 am-form-label">学员姓名 </label>
            <div class="am-u-sm-9">
              <input type="text" id="name" placeholder="姓名">
            </div>
          </div>
          
        
          
          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">身份证号 </label>
            <div class="am-u-sm-9">
              <input type="text" id="identity" placeholder="身份证号 ">
            </div>
          </div>
          
          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">考试时间</label>
            <div class="am-u-sm-9">
              <input type="date" id="examTime" placeholder="考试时间">
            </div>
          </div>
          
          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">考试地点</label>
            <div class="am-u-sm-9">
              <input type="text" id="examPlace" placeholder="考试地点">
            </div>
          </div>
          
          <div class="am-form-group">
            <label  class="am-u-sm-3 am-form-label">考试成绩</label>
            <div class="am-u-sm-9">
              <input type="text" id="score" placeholder="考试成绩 ">
            </div>
          </div>
          
          <div class="am-form-group">
            <label  class="am-u-sm-3 am-form-label">考试评定 </label>
            <div class="am-u-sm-9">
              <input type="text" id="isrepeatExam" placeholder="考试评定（及格或不及格） ">
            </div>
          </div>
          

          
          <div class="am-form-group">
            <label  class="am-u-sm-3 am-form-label">补考次数 </label>
            <div class="am-u-sm-9">
              <input type="text" id="repeatNum" placeholder="补考次数 ">
            </div>
          </div>
          
 
          <div class="am-form-group">
            <div class="am-u-sm-9 am-u-sm-push-3">
              <button type="button" id="userBut" class="am-btn am-btn-primary">提交</button>
              <button type="button" id="ButFh" class="am-btn am-btn-primary">返回</button>
            </div>
          </div>
            
        </div>
      </div>
    </div>
  </div>
  <!-- content end -->

</div>
 
</body>
</html>
